#include<iostream>
#include<cstdlib>
#include<algorithm>
const int N = 1e7 + 10;
typedef long long ll;
ll a[N];
using namespace std;
int main()
{
	ll n, k;cin >> n >> k;ll MAX = 0;
	for (ll i = 1; i <= n; i++)
	{
		cin >> a[i];
		MAX = max(MAX, a[i]);
	}ll ret = 0;
	for (ll i = MAX; i >=0; i--)
	{
		ll	sum = 0;
		for (ll j = 1; j <= n; j++)
		{
			ll t = a[j] - i;
			if (t <= 0) continue;
			sum += t;
		}
		if (sum == k)
		{
			ret = i;
			break;
		}
	}
	cout << ret << endl;
	return 0;
}